Public Class frmLicense

    Private Sub frmLicense_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim licenseFile As IO.TextReader
        Dim license As String

        chkAgree.Checked = False

        licenseFile = IO.File.OpenText(Application.StartupPath & "\license.txt")
        license = licenseFile.ReadToEnd
        licenseFile.Close()

        txtLicense.Text = license
    End Sub

    Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click
        If Not chkAgree.Checked Then
            MsgBox("You must accept the license agreement in order to continue.  If you do not wish to accept the license then click 'Cancel'")
        Else
            Me.DialogResult = MsgBoxResult.Ok
            Me.Close()
        End If
    End Sub

    Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click
        Me.DialogResult = Windows.Forms.DialogResult.Cancel
        Me.Close()
    End Sub
End Class